//
//  RequestPartyLogin.m
//  HHNMobileCore
//
//  Created by 余海华 on 16/9/20.
//  Copyright © 2016年 huhmf. All rights reserved.
//

#import "RequestPartyLogin.h"
#import "CommonFileUtils.h"

@implementation RequestPartyLogin {
    
    NSString *_openId;
    NSString *_type;
}
- (id)initWithOpenId:(NSString *)openID andType:(NSString*) type {
    
    if (self = [super init]) {
    
        _openId = openID;
        _type = type;
    }
    
    return self;
}

-(NSInteger)cacheTimeInSeconds
{
    return -60*1;//为负数 不启用缓存
}

-(id)requestArgument
{
    return @{
             @"openId": [_openId length]?_openId:@"",
             @"type":[_type length]?_type:@""
             };
}


-(YTKRequestMethod)requestMethod
{
    return YTKRequestMethodPOST;
}

-(NSString *)requestUrl
{
    return @"/account/thirdBindingLogin.do";
}

-(NSDictionary *)requestHeaderFieldValueDictionary
{
    NSMutableURLRequest *request_M=(NSMutableURLRequest *)[super requestTask].currentRequest;

    NSString *strUrl=[NSString stringWithFormat:@"%@%@",appBaseURL,[self requestUrl]];
    NSDictionary *dict=[[HHNUtility sharedHHNInstance] setHttpHeaderWithUrl:strUrl Request:request_M];
    
    return dict;
}

@end
